command-line utility to extract the text from a PDF file. This utility (part of xpdf, released under the GPL) is rather clever in that it analyses text positions to find out about the correct logical order of the text, so it does far better than simply using the "Save text" option in PDF converters.